Option Explicit On 
Option Strict On

Public Class frmSourceInfo
    Inherits System.Windows.Forms.Form
    Public Shared oSource As SourceClass
    Public Shared oCite As CiteInfo
    Public Shared bCiteLWC As Boolean
    Public Shared oCiteLWC As CiteInfo
    Public Shared bUpdate As Boolean
    Private Shared IDtimeper As Collection
    Private Shared bSingle As Boolean
    Private Shared bRange As Boolean
    Private Shared bGregorian As Boolean
    Friend WithEvents button_example As System.Windows.Forms.Button
    Private Shared intTimeStyle As Integer = frmMetaMain.intTimeStyle


#Region " Windows Form Designer generated code "

    Public Sub New(ByVal inSource As SourceClass)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        oSource = inSource

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents btnEditCite As System.Windows.Forms.Button
    Friend WithEvents txtCite As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents txtCiteAbbrv As System.Windows.Forms.TextBox
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents cboxMedia As System.Windows.Forms.ComboBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents numScale As System.Windows.Forms.NumericUpDown
    Friend WithEvents txtContrib As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents pnlTime As System.Windows.Forms.Panel
    Friend WithEvents cboxCurRef As System.Windows.Forms.ComboBox
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents btnTimeDelete As System.Windows.Forms.Button
    Friend WithEvents btnTimeEdit As System.Windows.Forms.Button
    Friend WithEvents btnTimeAdd As System.Windows.Forms.Button
    Friend WithEvents lboxTime As System.Windows.Forms.ListBox
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents rdoTRange As System.Windows.Forms.RadioButton
    Friend WithEvents rdoTMult As System.Windows.Forms.RadioButton
    Friend WithEvents rdoTSingle As System.Windows.Forms.RadioButton
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents rdoTGeol As System.Windows.Forms.RadioButton
    Friend WithEvents rdoTLocal As System.Windows.Forms.RadioButton
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSourceInfo))
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.button_example = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnOK = New System.Windows.Forms.Button
        Me.pnlTime = New System.Windows.Forms.Panel
        Me.cboxCurRef = New System.Windows.Forms.ComboBox
        Me.Label12 = New System.Windows.Forms.Label
        Me.btnTimeDelete = New System.Windows.Forms.Button
        Me.btnTimeEdit = New System.Windows.Forms.Button
        Me.btnTimeAdd = New System.Windows.Forms.Button
        Me.lboxTime = New System.Windows.Forms.ListBox
        Me.Label15 = New System.Windows.Forms.Label
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.rdoTRange = New System.Windows.Forms.RadioButton
        Me.rdoTMult = New System.Windows.Forms.RadioButton
        Me.rdoTSingle = New System.Windows.Forms.RadioButton
        Me.Label13 = New System.Windows.Forms.Label
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.rdoTGeol = New System.Windows.Forms.RadioButton
        Me.rdoTLocal = New System.Windows.Forms.RadioButton
        Me.Label11 = New System.Windows.Forms.Label
        Me.Label10 = New System.Windows.Forms.Label
        Me.txtContrib = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.numScale = New System.Windows.Forms.NumericUpDown
        Me.Label4 = New System.Windows.Forms.Label
        Me.cboxMedia = New System.Windows.Forms.ComboBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtCiteAbbrv = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.btnEditCite = New System.Windows.Forms.Button
        Me.txtCite = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Panel1.SuspendLayout()
        Me.pnlTime.SuspendLayout()
        Me.Panel2.SuspendLayout()
        Me.Panel3.SuspendLayout()
        CType(Me.numScale, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Panel1
        '
        Me.Panel1.AutoScroll = True
        Me.Panel1.Controls.Add(Me.button_example)
        Me.Panel1.Controls.Add(Me.btnCancel)
        Me.Panel1.Controls.Add(Me.btnOK)
        Me.Panel1.Controls.Add(Me.pnlTime)
        Me.Panel1.Controls.Add(Me.txtContrib)
        Me.Panel1.Controls.Add(Me.Label5)
        Me.Panel1.Controls.Add(Me.numScale)
        Me.Panel1.Controls.Add(Me.Label4)
        Me.Panel1.Controls.Add(Me.cboxMedia)
        Me.Panel1.Controls.Add(Me.Label3)
        Me.Panel1.Controls.Add(Me.txtCiteAbbrv)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.btnEditCite)
        Me.Panel1.Controls.Add(Me.txtCite)
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Location = New System.Drawing.Point(0, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(639, 542)
        Me.Panel1.TabIndex = 0
        Me.ToolTip1.SetToolTip(Me.Panel1, "list of sources and a short discussion of the information contributed by each. ")
        '
        'button_example
        '
        Me.button_example.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.button_example.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.button_example.Image = Global.MetaDoc.My.Resources.Resources.app_help_48x48
        Me.button_example.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.button_example.Location = New System.Drawing.Point(519, 12)
        Me.button_example.Name = "button_example"
        Me.button_example.Size = New System.Drawing.Size(110, 48)
        Me.button_example.TabIndex = 21
        Me.button_example.Text = "EXAMPLE"
        Me.button_example.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.button_example.UseVisualStyleBackColor = True
        '
        'btnCancel
        '
        Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCancel.Image = Global.MetaDoc.My.Resources.Resources.Cancel_16x16
        Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnCancel.Location = New System.Drawing.Point(554, 508)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(75, 23)
        Me.btnCancel.TabIndex = 20
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnOK
        '
        Me.btnOK.Enabled = False
        Me.btnOK.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnOK.Image = Global.MetaDoc.My.Resources.Resources.Ok_16x16
        Me.btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnOK.Location = New System.Drawing.Point(473, 508)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(75, 23)
        Me.btnOK.TabIndex = 19
        Me.btnOK.Text = "OK"
        Me.btnOK.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'pnlTime
        '
        Me.pnlTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.pnlTime.Controls.Add(Me.cboxCurRef)
        Me.pnlTime.Controls.Add(Me.Label12)
        Me.pnlTime.Controls.Add(Me.btnTimeDelete)
        Me.pnlTime.Controls.Add(Me.btnTimeEdit)
        Me.pnlTime.Controls.Add(Me.btnTimeAdd)
        Me.pnlTime.Controls.Add(Me.lboxTime)
        Me.pnlTime.Controls.Add(Me.Label15)
        Me.pnlTime.Controls.Add(Me.Panel2)
        Me.pnlTime.Controls.Add(Me.Label13)
        Me.pnlTime.Controls.Add(Me.Panel3)
        Me.pnlTime.Controls.Add(Me.Label11)
        Me.pnlTime.Controls.Add(Me.Label10)
        Me.pnlTime.Location = New System.Drawing.Point(15, 254)
        Me.pnlTime.Name = "pnlTime"
        Me.pnlTime.Size = New System.Drawing.Size(614, 248)
        Me.pnlTime.TabIndex = 17
        Me.ToolTip1.SetToolTip(Me.pnlTime, "Time Period of Content")
        '
        'cboxCurRef
        '
        Me.cboxCurRef.Items.AddRange(New Object() {"ground condition", "observed", "publication date"})
        Me.cboxCurRef.Location = New System.Drawing.Point(112, 211)
        Me.cboxCurRef.Name = "cboxCurRef"
        Me.cboxCurRef.Size = New System.Drawing.Size(136, 21)
        Me.cboxCurRef.TabIndex = 12
        Me.ToolTip1.SetToolTip(Me.cboxCurRef, "the basis on which the source time period of" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "content information of the source d" & _
                "ata set is determined.")
        '
        'Label12
        '
        Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label12.Location = New System.Drawing.Point(16, 214)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(136, 32)
        Me.Label12.TabIndex = 11
        Me.Label12.Text = "Currentness Reference"
        Me.ToolTip1.SetToolTip(Me.Label12, "the basis on which the source time period of" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "content information of the source d" & _
                "ata set is determined.")
        '
        'btnTimeDelete
        '
        Me.btnTimeDelete.Enabled = False
        Me.btnTimeDelete.Image = Global.MetaDoc.My.Resources.Resources.file_del_16x16
        Me.btnTimeDelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnTimeDelete.Location = New System.Drawing.Point(397, 174)
        Me.btnTimeDelete.Name = "btnTimeDelete"
        Me.btnTimeDelete.Size = New System.Drawing.Size(75, 23)
        Me.btnTimeDelete.TabIndex = 10
        Me.btnTimeDelete.Text = "Delete"
        '
        'btnTimeEdit
        '
        Me.btnTimeEdit.Enabled = False
        Me.btnTimeEdit.Image = CType(resources.GetObject("btnTimeEdit.Image"), System.Drawing.Image)
        Me.btnTimeEdit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnTimeEdit.Location = New System.Drawing.Point(316, 174)
        Me.btnTimeEdit.Name = "btnTimeEdit"
        Me.btnTimeEdit.Size = New System.Drawing.Size(75, 23)
        Me.btnTimeEdit.TabIndex = 9
        Me.btnTimeEdit.Text = "Edit"
        '
        'btnTimeAdd
        '
        Me.btnTimeAdd.Image = Global.MetaDoc.My.Resources.Resources.file_new_16x16
        Me.btnTimeAdd.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnTimeAdd.Location = New System.Drawing.Point(235, 174)
        Me.btnTimeAdd.Name = "btnTimeAdd"
        Me.btnTimeAdd.Size = New System.Drawing.Size(75, 23)
        Me.btnTimeAdd.TabIndex = 8
        Me.btnTimeAdd.Text = "Add"
        '
        'lboxTime
        '
        Me.lboxTime.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.lboxTime.Location = New System.Drawing.Point(112, 129)
        Me.lboxTime.Name = "lboxTime"
        Me.lboxTime.Size = New System.Drawing.Size(360, 39)
        Me.lboxTime.TabIndex = 7
        Me.ToolTip1.SetToolTip(Me.lboxTime, "time period(s) for which the source data set corresponds to the ground. ")
        '
        'Label15
        '
        Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label15.Location = New System.Drawing.Point(16, 129)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(96, 23)
        Me.Label15.TabIndex = 6
        Me.Label15.Text = "Time Period(s):"
        Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.ToolTip1.SetToolTip(Me.Label15, "time period(s) for which the source data set corresponds to the ground. ")
        '
        'Panel2
        '
        Me.Panel2.Controls.Add(Me.rdoTRange)
        Me.Panel2.Controls.Add(Me.rdoTMult)
        Me.Panel2.Controls.Add(Me.rdoTSingle)
        Me.Panel2.Location = New System.Drawing.Point(112, 35)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(128, 88)
        Me.Panel2.TabIndex = 5
        '
        'rdoTRange
        '
        Me.rdoTRange.Checked = True
        Me.rdoTRange.Location = New System.Drawing.Point(8, 56)
        Me.rdoTRange.Name = "rdoTRange"
        Me.rdoTRange.Size = New System.Drawing.Size(112, 24)
        Me.rdoTRange.TabIndex = 2
        Me.rdoTRange.TabStop = True
        Me.rdoTRange.Text = "A range of dates"
        '
        'rdoTMult
        '
        Me.rdoTMult.Location = New System.Drawing.Point(8, 32)
        Me.rdoTMult.Name = "rdoTMult"
        Me.rdoTMult.Size = New System.Drawing.Size(104, 24)
        Me.rdoTMult.TabIndex = 1
        Me.rdoTMult.Text = "Multiple dates"
        '
        'rdoTSingle
        '
        Me.rdoTSingle.Location = New System.Drawing.Point(8, 8)
        Me.rdoTSingle.Name = "rdoTSingle"
        Me.rdoTSingle.Size = New System.Drawing.Size(96, 24)
        Me.rdoTSingle.TabIndex = 0
        Me.rdoTSingle.Text = "A single date"
        '
        'Label13
        '
        Me.Label13.Location = New System.Drawing.Point(16, 40)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(80, 23)
        Me.Label13.TabIndex = 4
        Me.Label13.Text = "Data are from"
        Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Panel3
        '
        Me.Panel3.Controls.Add(Me.rdoTGeol)
        Me.Panel3.Controls.Add(Me.rdoTLocal)
        Me.Panel3.Location = New System.Drawing.Point(334, 35)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(96, 64)
        Me.Panel3.TabIndex = 2
        '
        'rdoTGeol
        '
        Me.rdoTGeol.Location = New System.Drawing.Point(8, 32)
        Me.rdoTGeol.Name = "rdoTGeol"
        Me.rdoTGeol.Size = New System.Drawing.Size(72, 24)
        Me.rdoTGeol.TabIndex = 1
        Me.rdoTGeol.Text = "Geologic"
        '
        'rdoTLocal
        '
        Me.rdoTLocal.Checked = True
        Me.rdoTLocal.Location = New System.Drawing.Point(8, 8)
        Me.rdoTLocal.Name = "rdoTLocal"
        Me.rdoTLocal.Size = New System.Drawing.Size(80, 24)
        Me.rdoTLocal.TabIndex = 0
        Me.rdoTLocal.TabStop = True
        Me.rdoTLocal.Text = "Gregorian"
        '
        'Label11
        '
        Me.Label11.ImageAlign = System.Drawing.ContentAlignment.TopCenter
        Me.Label11.Location = New System.Drawing.Point(251, 40)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(96, 23)
        Me.Label11.TabIndex = 1
        Me.Label11.Text = "The calendar is:"
        Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label10
        '
        Me.Label10.Dock = System.Windows.Forms.DockStyle.Top
        Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label10.Location = New System.Drawing.Point(0, 0)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(610, 23)
        Me.Label10.TabIndex = 0
        Me.Label10.Text = "Time Period of Content"
        Me.Label10.TextAlign = System.Drawing.ContentAlignment.TopCenter
        Me.ToolTip1.SetToolTip(Me.Label10, "Time Period of Content")
        '
        'txtContrib
        '
        Me.txtContrib.AcceptsReturn = True
        Me.txtContrib.Location = New System.Drawing.Point(178, 148)
        Me.txtContrib.Multiline = True
        Me.txtContrib.Name = "txtContrib"
        Me.txtContrib.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtContrib.Size = New System.Drawing.Size(450, 100)
        Me.txtContrib.TabIndex = 16
        Me.ToolTip1.SetToolTip(Me.txtContrib, "brief statement identifying the information contributed by the source to the data" & _
                " set. ")
        '
        'Label5
        '
        Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.Location = New System.Drawing.Point(12, 151)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(176, 23)
        Me.Label5.TabIndex = 15
        Me.Label5.Text = "Source Contribution"
        Me.ToolTip1.SetToolTip(Me.Label5, "brief statement identifying the information contributed by the source to the data" & _
                " set. ")
        '
        'numScale
        '
        Me.numScale.Location = New System.Drawing.Point(178, 116)
        Me.numScale.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0})
        Me.numScale.Name = "numScale"
        Me.numScale.Size = New System.Drawing.Size(120, 20)
        Me.numScale.TabIndex = 14
        Me.numScale.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.numScale.ThousandsSeparator = True
        Me.ToolTip1.SetToolTip(Me.numScale, "the denominator of the representative fraction on a map" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "(for example, on a 1:24," & _
                "000-scale map, the Source Scale Denominator is 24000)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "    Domain: Source Scale" & _
                " Denominator > 1 ")
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(12, 118)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(152, 23)
        Me.Label4.TabIndex = 13
        Me.Label4.Text = "Source Scale Denominator"
        Me.ToolTip1.SetToolTip(Me.Label4, "the denominator of the representative fraction on a map" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "(for example, on a 1:24," & _
                "000-scale map, the Source Scale Denominator is 24000)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "    Domain: Source Scale" & _
                " Denominator > 1 ")
        '
        'cboxMedia
        '
        Me.cboxMedia.Items.AddRange(New Object() {"paper", "stable-base material", "microfiche", "microfilm", "audiocassette", "chart", "filmstrip", "transparency", "physical model", "computer program", "disc", "online", "CD-ROM", "DVD", "-------NBII----------------------------", "digital database file", "field notes", "photographic print", "printed table", "visually observed or measured", "------older FGDC------------------", "cartridge tape", "magnetic tape", "videocassette", "videodisc", "videotape", "electronic bulletin board", "electronic mail system"})
        Me.cboxMedia.Location = New System.Drawing.Point(178, 81)
        Me.cboxMedia.Name = "cboxMedia"
        Me.cboxMedia.Size = New System.Drawing.Size(176, 21)
        Me.cboxMedia.TabIndex = 12
        Me.ToolTip1.SetToolTip(Me.cboxMedia, "the medium of the source data set. ")
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(12, 84)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(160, 23)
        Me.Label3.TabIndex = 11
        Me.Label3.Text = "Type of Source Media"
        Me.ToolTip1.SetToolTip(Me.Label3, "the medium of the source data set. ")
        '
        'txtCiteAbbrv
        '
        Me.txtCiteAbbrv.Location = New System.Drawing.Point(178, 49)
        Me.txtCiteAbbrv.Name = "txtCiteAbbrv"
        Me.txtCiteAbbrv.Size = New System.Drawing.Size(256, 20)
        Me.txtCiteAbbrv.TabIndex = 10
        Me.ToolTip1.SetToolTip(Me.txtCiteAbbrv, "short-form alias for the source citation. ")
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(12, 52)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(176, 23)
        Me.Label2.TabIndex = 9
        Me.Label2.Text = "Source Citation Abbreviation"
        Me.ToolTip1.SetToolTip(Me.Label2, "short-form alias for the source citation. ")
        '
        'btnEditCite
        '
        Me.btnEditCite.Image = CType(resources.GetObject("btnEditCite.Image"), System.Drawing.Image)
        Me.btnEditCite.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnEditCite.Location = New System.Drawing.Point(414, 19)
        Me.btnEditCite.Name = "btnEditCite"
        Me.btnEditCite.Size = New System.Drawing.Size(75, 23)
        Me.btnEditCite.TabIndex = 8
        Me.btnEditCite.Text = "Edit"
        '
        'txtCite
        '
        Me.txtCite.Location = New System.Drawing.Point(178, 21)
        Me.txtCite.Name = "txtCite"
        Me.txtCite.ReadOnly = True
        Me.txtCite.Size = New System.Drawing.Size(230, 20)
        Me.txtCite.TabIndex = 7
        Me.txtCite.TabStop = False
        Me.ToolTip1.SetToolTip(Me.txtCite, "reference for a source data set.")
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(12, 24)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(120, 23)
        Me.Label1.TabIndex = 6
        Me.Label1.Text = "Source Citation"
        Me.ToolTip1.SetToolTip(Me.Label1, "reference for a source data set.")
        '
        'ToolTip1
        '
        Me.ToolTip1.IsBalloon = True
        Me.ToolTip1.ShowAlways = True
        Me.ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
        '
        'frmSourceInfo
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(641, 545)
        Me.ControlBox = False
        Me.Controls.Add(Me.Panel1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmSourceInfo"
        Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Source Information"
        Me.ToolTip1.SetToolTip(Me, "list of sources and a short discussion of the information contributed by each. ")
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        Me.pnlTime.ResumeLayout(False)
        Me.Panel2.ResumeLayout(False)
        Me.Panel3.ResumeLayout(False)
        CType(Me.numScale, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmSourceInfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim s1 As String = ""
        Dim iCount As Integer
        Dim iLoop As Integer

        bUpdate = False
        oCite = New CiteInfo
        bCiteLWC = False
        oCiteLWC = New CiteInfo
        IDtimeper = New Collection

        'load Source Citation
        oCite = oSource.SourceCite
        bCiteLWC = oSource.boolLWC
        oCiteLWC = oSource.SourceLWC
        s1 = oCite.Author & ":  " & oCite.Title
        txtCite.Text = s1

        'load Citation Abbreviation
        txtCiteAbbrv.Text = oSource.CiteAbbrv

        'load Source Media Type combo box
        s1 = oSource.Media
        If (s1 = "") Then
            cboxMedia.SelectedIndex = -1
        Else
            iCount = cboxMedia.FindStringExact(s1)
            If (iCount = -1) Then
                cboxMedia.Items.Add(s1)
                cboxMedia.SelectedIndex = cboxMedia.Items.Count - 1
            Else
                cboxMedia.SelectedIndex = iCount
            End If
        End If

        'load the Source Scale Denominator
        s1 = oSource.ScaleDenom
        If (s1 = "") Then
            numScale.Value = 0
        Else
            numScale.Value = CType(s1, Decimal)
        End If

        'load the Source Contribution
        txtContrib.Text = oSource.Contrib

        'load Time Period of Content
        'first, load Time Period Information
        IDtimeper = oSource.TimePeriod
        bSingle = oSource.boolSingle
        bRange = oSource.boolRange
        bGregorian = oSource.Gregorian
        If (bSingle = True) Then 'set up date type: single, multiple, or range
            rdoTSingle.Checked = True
        Else
            If (bRange = True) Then
                rdoTRange.Checked = True
            Else
                rdoTMult.Checked = True
            End If
        End If
        If (bGregorian = True) Then 'set up time style: Gregorian or Geologic Age
            rdoTLocal.Checked = True
        Else
            rdoTGeol.Checked = True
        End If
        iCount = IDtimeper.Count 'get number of times to load into list box; 1-based index
        If (bGregorian = True) Then  'fill list box with Gregorian dates
            If (bRange = False) Then
                Dim dSingle As New SngDateTime 'add single or multiple date/time
                For iLoop = 1 To iCount
                    dsingle = CType(IDtimeper(iLoop), SngDateTime)
                    s1 = dSingle.SngDate & "  " & dSingle.TimeOfDay
                    lboxTime.Items.Add(s1)
                Next
            Else
                Dim dBegin As New SngDateTime     'add date/time range
                Dim dEnding As New SngDateTime
                For iLoop = 1 To iCount Step 2
                    dBegin = CType(IDtimeper(iLoop), SngDateTime)
                    dEnding = CType(IDtimeper(iLoop + 1), SngDateTime)
                    s1 = "begin: " & dBegin.SngDate & "  " & "end: " & dEnding.SngDate
                    lboxTime.Items.Add(s1)
                Next
            End If
        Else  'fill list box with Geologic Ages
            If (bRange = False) Then
                Dim dSingle As New GeolAge 'add single or multiple Geologic Age
                For iLoop = 1 To iCount
                    dsingle = CType(IDtimeper(iLoop), GeolAge)
                    s1 = dSingle.TimeScale & "  " & dSingle.Estim
                    lboxTime.Items.Add(s1)
                Next
            Else
                Dim dBegin As New GeolAge     'add date/time range
                Dim dEnding As New GeolAge
                For iLoop = 1 To iCount Step 2
                    dBegin = CType(IDtimeper(iLoop), GeolAge)
                    dEnding = CType(IDtimeper(iLoop + 1), GeolAge)
                    s1 = "begin: " & dBegin.Estim & "  " & "end: " & dEnding.Estim
                    lboxTime.Items.Add(s1)
                Next
            End If
        End If

        'second, load Currentness Reference for Time Period of Content
        s1 = oSource.Currentness
        If (s1 = "") Then
            cboxCurRef.SelectedIndex = -1
        Else
            iCount = cboxCurRef.FindStringExact(s1)
            If (iCount = -1) Then
                cboxCurRef.Items.Add(s1)
                cboxCurRef.SelectedIndex = cboxCurRef.Items.Count - 1
            Else
                cboxCurRef.SelectedIndex = iCount
            End If
        End If

    End Sub

    Private Sub btnEditCite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEditCite.Click
        Dim sTemp As String = ""
        Dim iTimeVal As Integer = frmMetaMain.intTimeStyle
        Dim frmSourceCite As New frmCiteInfo(oCite, oCiteLWC, bCiteLWC, iTimeVal)
        frmSourceCite.ShowDialog()
        If frmSourceCite.getUpdated() Then 'update the citation and text box
            oCite = frmSourceCite.getNewCite()
            bCiteLWC = frmSourceCite.getLWC()
            oCiteLWC = frmSourceCite.getNewLWC()
            sTemp = oCite.Author & ":  " & oCite.Title
            txtCite.Text = sTemp
        End If
        validateOK()
    End Sub

    Public Function getUpdated() As Boolean
        Return bUpdate
    End Function
    Public Function getSource() As SourceClass
        Return oSource
    End Function

#Region " Handling routines for Time Period Information panel "

    Private Sub btnTimeAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeAdd.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim strNewDate As String = ""
        If (rdoTLocal.Checked = True) Then  'process Gregorian dates
            If (rdoTSingle.Checked = True And iCount = 1) Then
                MessageBox.Show("Can't add another date to single date/time", "Add date error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Return
            End If
            If (rdoTRange.Checked = False) Then  'add and update 1 date/time
                Dim dSingle As New SngDateTime
                Dim frmTDate As New frmTimePeriod(intTimeStyle, dSingle)
                frmTDate.ShowDialog()
                If (frmTDate.getChanged() = False) Then
                Else
                    dSingle = frmTDate.getBegDate()
                    IDtimeper.Add(dSingle)
                    strNewDate = dSingle.SngDate & "  " & dSingle.TimeOfDay
                    lboxTime.Items.Add(strNewDate)
                End If
            Else
                If (rdoTRange.Checked = True And iCount > 1) Then
                    MessageBox.Show("Can only have 1 date range.", "Add date range error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    Return
                End If
                Dim dBegin As New SngDateTime     'add and update date/time range
                Dim dEnding As New SngDateTime
                Dim frmTDate As New frmTimePeriod(intTimeStyle, dBegin, dEnding)
                frmTDate.ShowDialog()
                If (frmTDate.getChanged() = False) Then
                Else
                    dBegin = frmTDate.getBegDate()
                    dEnding = frmTDate.getendDate()
                    IDtimeper.Add(dBegin)
                    IDtimeper.Add(dEnding)
                    strNewDate = "begin: " & dBegin.SngDate & "  " & "end: " & dEnding.SngDate
                    lboxTime.Items.Add(strNewDate)
                End If
            End If
        Else                              'process Geologic Age dates
            If (rdoTSingle.Checked = True And iCount = 1) Then
                MessageBox.Show("Can't add another Age to single Geologic Age", "Add Geologic Age", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Return
            End If
            If (rdoTRange.Checked = False) Then  'add and update 1 Geologic Age
                Dim dSingle As New GeolAge
                Dim frmTDate As New frmGeolAge(dSingle)
                frmTDate.ShowDialog()
                If (frmTDate.getChanged() = False) Then
                Else
                    dSingle = frmTDate.getBegGeol()
                    IDtimeper.Add(dSingle)
                    strNewDate = dSingle.TimeScale & "  " & dSingle.Estim
                    lboxTime.Items.Add(strNewDate)
                End If
            Else
                If (rdoTRange.Checked = True And iCount > 1) Then
                    MessageBox.Show("Can only have 1 Geologic Age range.", "Add Geologic Age range error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    Return
                End If
                Dim dBegin As New GeolAge     'add and update Geologic Age range
                Dim dEnding As New GeolAge
                Dim frmTDate As New frmGeolAge(dBegin, dEnding)
                frmTDate.ShowDialog()
                If (frmTDate.getChanged() = False) Then
                Else
                    dBegin = frmTDate.getBegGeol()
                    dEnding = frmTDate.getEndGeol()
                    IDtimeper.Add(dBegin)
                    IDtimeper.Add(dEnding)
                    strNewDate = "begin: " & dBegin.Estim & "  " & "end: " & dEnding.Estim
                    lboxTime.Items.Add(strNewDate)
                End If
            End If
        End If
        validateOK()
    End Sub

    Private Sub btnTimeEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeEdit.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim iToEdit1 As Integer = 0
        Dim iToEdit2 As Integer = 0
        Dim iToRemove As Integer = 0
        Dim strNewDate As String = ""
        Dim strError As String = ""

        btnTimeEdit.Enabled = False
        btnTimeDelete.Enabled = False
        validateOK()

        If (iCount = 0) Then 'Edit button pressed by mistake -- no entries to edit
            strError = "There are no Time Period entries to edit."
            MessageBox.Show(strError, "Edit button error", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return
        End If
        If (rdoTLocal.Checked = True) Then  'Gregorian dates section
            If (rdoTSingle.Checked = True) Then 'Edits a single date
                Dim dSingle As New SngDateTime
                dsingle = CType(IDtimeper(1), SngDateTime)
                Dim frmTDate1 As New frmTimePeriod(intTimeStyle, dSingle)
                frmTDate1.ShowDialog()
                If (frmTDate1.getChanged() = False) Then 'update was cancelled
                Else
                    dSingle = frmTDate1.getBegDate()          'get updated single date/time
                    IDtimeper.Remove(1)                  'clear existing single date/time
                    lboxTime.Items.Clear()
                    IDtimeper.Add(dSingle)               'add updated single date/time to collection and form
                    strNewDate = dSingle.SngDate & "  " & dSingle.TimeOfDay
                    lboxTime.Items.Add(strNewDate)
                End If
                Return
            End If
            If (rdoTMult.Checked = True) Then  'Edits member of multiple date/time collection
                Dim dSingle As New SngDateTime
                iToEdit1 = lboxTime.SelectedIndex 'zero-based index
                If (iCount = 1) Then iToEdit1 = 0
                If (iToEdit1 = -1) Then
                    strError = "One of the Time Period entries must be selected for editing."
                    MessageBox.Show(strError, "Date editing selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    Return
                End If
                dsingle = CType(IDtimeper(iToEdit1 + 1), SngDateTime) 'collection is one-based index
                Dim frmTDate2 As New frmTimePeriod(intTimeStyle, dSingle)
                frmTDate2.ShowDialog()
                If (frmTDate2.getChanged() = False) Then 'update was cancelled
                Else
                    dSingle = frmTDate2.getBegDate()             'get updated date/time entry
                    IDtimeper.Add(dSingle, , iToEdit1 + 1)  'add to collection before original version of entry
                    IDtimeper.Remove(iToEdit1 + 2)          'remove old version of entry from collection
                    strNewDate = dSingle.SngDate & "  " & dSingle.TimeOfDay
                    lboxTime.Items.Insert(iToEdit1, strNewDate)  'insert edited entry into listbox
                    lboxTime.Items.RemoveAt(iToEdit1 + 1)        'remove old version from listbox
                End If
                Return
            End If
            If (rdoTRange.Checked = True) Then     'Edits a date/time range
                Dim dBegin As New SngDateTime
                Dim dEnding As New SngDateTime
                dBegin = CType(IDtimeper(1), SngDateTime)
                dEnding = CType(IDtimeper(2), SngDateTime)
                Dim frmTDate As New frmTimePeriod(intTimeStyle, dBegin, dEnding)
                frmTDate.ShowDialog()
                If (frmTDate.getChanged() = False) Then 'update was cancelled
                Else
                    dBegin = frmTDate.getBegDate()            'get updated date/time range
                    dEnding = frmTDate.getEndDate()
                    IDtimeper.Remove(2)                  'remove old range entries from collection and listbox
                    IDtimeper.Remove(1)
                    lboxTime.Items.Clear()
                    IDtimeper.Add(dBegin)                 'add new range entries to collection and listbox
                    IDtimeper.Add(dEnding)
                    strNewDate = "begin: " & dBegin.SngDate & "  " & "end: " & dEnding.SngDate
                    lboxTime.Items.Add(strNewDate)
                End If
                Return
            End If
        Else        'process Geologic Ages
            If (rdoTSingle.Checked = True) Then 'Edits a single Geologic Age
                Dim dSingle As New GeolAge
                dSingle = CType(IDtimeper(1), GeolAge)
                Dim frmTGeol1 As New frmGeolAge(dsingle)
                frmTGeol1.ShowDialog()
                If (frmTGeol1.getChanged() = False) Then 'update was cancelled
                Else
                    dSingle = frmTGeol1.getBegGeol()          'get updated single date/time
                    IDtimeper.Remove(1)                  'clear existing single date/time
                    lboxTime.Items.Clear()
                    IDtimeper.Add(dSingle)               'add updated single date/time to collection and form
                    strNewDate = dSingle.TimeScale & "  " & dSingle.Estim
                    lboxTime.Items.Add(strNewDate)
                End If
                Return
            End If
            If (rdoTMult.Checked = True) Then  'Edits member of multiple Geologic Age collection
                Dim dSingle As New GeolAge
                iToEdit1 = lboxTime.SelectedIndex 'zero-based index
                If (iCount = 1) Then iToEdit1 = 0
                If (iToEdit1 = -1) Then
                    strError = "One of the Time Period entries must be selected for editing."
                    MessageBox.Show(strError, "Date editing selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    Return
                End If
                dSingle = CType(IDtimeper(iToEdit1 + 1), GeolAge) 'collection is one-based index
                Dim frmTGeol2 As New frmGeolAge(dSingle)
                frmTGeol2.ShowDialog()
                If (frmTGeol2.getChanged() = False) Then 'update was cancelled
                Else
                    dSingle = frmTGeol2.getBegGeol()             'get updated date/time entry
                    IDtimeper.Add(dSingle, , iToEdit1 + 1)  'add to collection before original version of entry
                    IDtimeper.Remove(iToEdit1 + 2)          'remove old version of entry from collection
                    strNewDate = dSingle.TimeScale & "  " & dSingle.Estim
                    lboxTime.Items.Insert(iToEdit1, strNewDate)  'insert edited entry into listbox
                    lboxTime.Items.RemoveAt(iToEdit1 + 1)        'remove old version from listbox
                End If
                Return
            End If
            If (rdoTRange.Checked = True) Then     'Edits a Geologic Age range
                Dim dBegin As New GeolAge
                Dim dEnding As New GeolAge
                dBegin = CType(IDtimeper(1), GeolAge)
                dEnding = CType(IDtimeper(2), GeolAge)
                Dim frmTGeol As New frmGeolAge(dBegin, dEnding)
                frmTGeol.ShowDialog()
                If (frmTGeol.getChanged() = False) Then 'update was cancelled
                Else
                    dBegin = frmTGeol.getBegGeol()            'get updated date/time range
                    dEnding = frmTGeol.getEndGeol()
                    IDtimeper.Remove(2)                  'remove old range entries from collection and listbox
                    IDtimeper.Remove(1)
                    lboxTime.Items.Clear()
                    IDtimeper.Add(dBegin)                 'add new range entries to collection and listbox
                    IDtimeper.Add(dEnding)
                    strNewDate = "begin: " & dBegin.Estim & "  " & "end: " & dEnding.Estim
                    lboxTime.Items.Add(strNewDate)
                End If
                Return
            End If
        End If
    End Sub

    Private Sub btnTimeDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimeDelete.Click
        Dim strError As String = ""
        Dim iCount As Integer = IDtimeper.Count
        Dim iToRemove As Integer = 0

        btnTimeEdit.Enabled = False
        btnTimeDelete.Enabled = False

        If (iCount = 0) Then 'Delete button pressed by mistake -- no entries to edit
            strError = "There are no Time Period entries to delete."
            MessageBox.Show(strError, "Selection error", MessageBoxButtons.OK, MessageBoxIcon.Information)
            validateOK()
            Return
        End If
        If (rdoTSingle.Checked = True) Then 'Deletes a single date
            IDtimeper.Remove(1)
            lboxTime.Items.Clear()
            validateOK()
            Return
        End If
        If (rdoTRange.Checked = True) Then 'Deletes a range
            IDtimeper.Remove(2)
            IDtimeper.Remove(1)
            lboxTime.Items.Clear()
            validateOK()
            Return
        End If
        iToRemove = lboxTime.SelectedIndex 'zero-based index
        If (iToRemove = -1) Then
            Dim sDelError As String = "No date selected for deletion"
            MessageBox.Show(sDelError, "Selection error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            validateOK()
            Return
        End If
        IDtimeper.Remove(iToRemove + 1)
        lboxTime.Items.RemoveAt(iToRemove)
        validateOK()
    End Sub

    Private Sub rdoTSingle_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoTSingle.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim iLoop As Integer = 0
        Dim dSingle As New SngDateTime
        Dim gSingle As New GeolAge
        Dim strNewDate As String = ""

        If (rdoTLocal.Checked = True) Then  'process Gregorian date/time
            If (rdoTSingle.Checked = True And iCount > 1) Then 'bring collection & list into conformance with being Single
                dSingle = CType(IDtimeper(1), SngDateTime)
                strNewDate = dSingle.SngDate & "  " & dSingle.TimeOfDay
                IDtimeper = New Collection
                IDtimeper.Add(dSingle)
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
            End If
        Else                               'process Geologic Age
            If (rdoTSingle.Checked = True And iCount > 1) Then 'bring collection & list into conformance with being Single
                gSingle = CType(IDtimeper(1), GeolAge)
                strNewDate = gSingle.TimeScale & "  " & gSingle.Estim
                IDtimeper = New Collection
                IDtimeper.Add(gSingle)
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
            End If
        End If
        validateOK()
    End Sub

    Private Sub rdoTMult_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoTMult.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim iLoop As Integer = 0
        Dim strNewDate As String = ""
        Dim strNewDate2 As String = ""

        If (rdoTLocal.Checked = True) Then  'process Gregorian date/time
            If (rdoTMult.Checked = True And iCount = 2) Then
                Dim dBegin As New SngDateTime
                Dim dEnding As New SngDateTime
                dBegin = CType(IDtimeper(1), SngDateTime)
                dEnding = CType(IDtimeper(iCount), SngDateTime)
                strNewDate = dBegin.SngDate & "  " & dBegin.TimeOfDay
                strNewDate2 = dEnding.SngDate & "  " & dEnding.TimeOfDay
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
                lboxTime.Items.Add(strNewDate2)
            End If
        Else                               'process Geologic Age
            If (rdoTMult.Checked = True And iCount = 2) Then
                Dim dBegin As New GeolAge
                Dim dEnding As New GeolAge
                dBegin = CType(IDtimeper(1), GeolAge)
                dEnding = CType(IDtimeper(iCount), GeolAge)
                strNewDate = dBegin.TimeScale & "  " & dBegin.Estim
                strNewDate2 = dEnding.TimeScale & "  " & dEnding.Estim
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
                lboxTime.Items.Add(strNewDate2)
            End If
        End If
        validateOK()
    End Sub

    Private Sub rdoTRange_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoTRange.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim iLoop As Integer = 0
        Dim strNewDate As String = ""

        If (rdoTLocal.Checked = True) Then   'process Gregorian date/time
            If (rdoTRange.Checked = True And iCount > 0) Then
                Dim dBegin As New SngDateTime
                Dim dEnding As New SngDateTime
                dBegin = CType(IDtimeper(1), SngDateTime)
                dEnding = CType(IDtimeper(iCount), SngDateTime)
                strNewDate = "begin: " & dBegin.SngDate & "  " & "end: " & dEnding.SngDate
                IDtimeper = New Collection
                IDtimeper.Add(dBegin)
                IDtimeper.Add(dEnding)
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
            End If
        Else                                  'process Geologic Age
            If (rdoTRange.Checked = True And iCount > 0) Then
                Dim dBegin As New GeolAge
                Dim dEnding As New GeolAge
                dBegin = CType(IDtimeper(1), GeolAge)
                dEnding = CType(IDtimeper(iCount), GeolAge)
                strNewDate = "begin: " & dBegin.Estim & "  " & "end: " & dEnding.Estim
                IDtimeper = New Collection
                IDtimeper.Add(dBegin)
                IDtimeper.Add(dEnding)
                lboxTime.Items.Clear()
                lboxTime.Items.Add(strNewDate)
            End If
        End If
        validateOK()
    End Sub

    Private Sub rdoTLocal_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoTLocal.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim objTest1 As New SngDateTime
        Dim objTest2 As New GeolAge

        If (iCount = 0) Then  'if no objects in collection, then no update necessary
            Return
        End If

        If (IDtimeper(1).GetType Is objTest1.GetType) Then 'click selects Gregorian; already in that type 
            Return
        ElseIf (IDtimeper(1).GetType Is objTest2.GetType) Then 'click selects Gregorian; remove Geologic collection
            IDtimeper = New Collection
            lboxTime.Items.Clear()
            Return
        Else
            MessageBox.Show("Unexpected object type. Contact program author", "Check multi-click on Gregorian date", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return
        End If
    End Sub

    Private Sub rdoTGeol_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoTGeol.Click
        Dim iCount As Integer = IDtimeper.Count
        Dim objTest1 As New GeolAge
        Dim objTest2 As New SngDateTime

        If (iCount = 0) Then  'if no objects in collection, then no update necessary
            Return
        End If

        If (IDtimeper(1).GetType Is objTest1.GetType) Then 'click selects Geologic; already in that type 
            Return
        ElseIf (IDtimeper(1).GetType Is objTest2.GetType) Then 'click selects Geologic; remove Gregorian collection
            IDtimeper = New Collection
            lboxTime.Items.Clear()
            Return
        Else
            MessageBox.Show("Unexpected object type. Contact program author", "Check multi-click on Gregorian date", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Return
        End If
    End Sub

#End Region


    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Dim iScale As Integer = 0
        Dim s1 As String = cboxMedia.Text
        If (s1.StartsWith("---") = True) Then 'invalid media type choice
            MessageBox.Show("Invalid Source Media Type", "Selection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return
        End If
        oSource.SourceCite = oCite
        oSource.boolLWC = bCiteLWC
        oSource.SourceLWC = oCiteLWC
        iScale = Convert.ToInt32(numScale.Value)
        If (iScale < 2) Then
            oSource.ScaleDenom = ""
        Else
            oSource.ScaleDenom = iScale.ToString
        End If
        oSource.Media = cboxMedia.Text

        'transfer time period information
        If (rdoTLocal.Checked = True) Then
            oSource.Gregorian = True
        Else
            oSource.Gregorian = False
        End If
        If (rdoTSingle.Checked = True) Then
            oSource.boolSingle = True     'date/time is single
            oSource.boolRange = False
        Else
            oSource.boolSingle = False
            If (rdoTRange.Checked = True) Then
                oSource.boolRange = True  'date/time is range
            Else
                oSource.boolRange = False 'date/time is multiple
            End If
        End If
        oSource.TimePeriod = IDtimeper

        'transfer remaining elements
        oSource.Currentness = cboxCurRef.Text
        oSource.CiteAbbrv = txtCiteAbbrv.Text
        oSource.Contrib = txtContrib.Text
        bUpdate = True
        Me.Close()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        bUpdate = False
        Me.Close()
    End Sub

    Private Sub txtCiteAbbrv_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtCiteAbbrv.TextChanged
        validateOK()
    End Sub

    Private Sub cboxMedia_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxMedia.SelectedIndexChanged
        validateOK()
    End Sub

    Private Sub txtContrib_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtContrib.TextChanged
        validateOK()
    End Sub

    Private Sub cboxCurRef_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboxCurRef.SelectedIndexChanged
        validateOK()
    End Sub

    Private Sub validateOK()
        If txtCite.Text.Trim() = ":" Or txtCiteAbbrv.Text.Trim() = "" Or cboxMedia.SelectedIndex = -1 Or txtContrib.Text.Trim() = "" Or cboxCurRef.SelectedIndex = -1 Or lboxTime.Items.Count = 0 Then btnOK.Enabled = False Else btnOK.Enabled = True
        If (rdoTSingle.Checked Or rdoTRange.Checked) And lboxTime.Items.Count >= 1 Then btnTimeAdd.Enabled = False Else btnTimeAdd.Enabled = True
    End Sub

    Private Sub lboxTime_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lboxTime.SelectedIndexChanged
        If lboxTime.SelectedItems.Count() > 0 Then
            btnTimeEdit.Enabled = True
            btnTimeDelete.Enabled = True
        End If
    End Sub

    Private Sub button_example_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_example.Click
        Dim helpForm As dialog_help = New dialog_help("SourceInfo")
        helpForm.ShowDialog()
    End Sub
End Class
